//
//  NVFilterController.h
//  Dianping
//
//  Created by ZhouHui on 12-4-10.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NVPickerObject : NSObject 
@property (nonatomic, retain) id leftObject;
@property (nonatomic, retain) NSArray *rightArray;
+ (id)pickerObjectWithLeftObject:(id)left withRightArray:(NSArray *)right;
- (id)initWithLeftObject:(id)left withRightArray:(NSArray *)right;
@end


typedef enum {
	FilterType1 = 1,
	FilterType2 = 2,
	FilterType3 = 3
}FilterType;

typedef enum {
    NVFilterNormalStyle = 1,
    NVFilterOnOffStyle = 2,
    NVFilterSwitchStyle = 3 ,
    NVFilterOnOffSwitchStyle = 4
} NVFilterStyle;

@protocol NVFilterControllerDelegate;
@interface NVFilterController : UIView <UIPickerViewDelegate> {	
    //
    //  if filterMomentary is Enable
    //  0x0010, 1-btn1 On,0-btn1 Off
    //  0x0100, 1-btn2 On,0-btn2 Off
    //  0x1000, 1-btn3 On,0-btn3 Off 
    //
    NSInteger _filterBtnOnOffState;
    
    NVFilterStyle   filterStyle;    
	FilterType      filterType;
	UIView *filterView;
	UIPickerView *filterPicker;
	UIActionSheet *filterSheet;
	
	UIImageView *dropImage1;
	UIImageView *dropImage2;
	UIImageView *dropImage3;
	
	NSArray *filterComponents1;
	NSArray *filterComponents2;
	NSArray *filterComponents3;
    
    UIImageView *selectedTabImageView;
}

@property (nonatomic) NSUInteger filterCount;
@property (nonatomic, strong) NSString *filterText1;
@property (nonatomic, readonly) UIView *filterViewSection1;
@property (nonatomic, assign) BOOL filter1NeedsDarkTabImage;

@property (nonatomic, strong) NSString *filterText2;
@property (nonatomic, readonly) UIView *filterViewSection2;
@property (nonatomic, assign) BOOL filter2NeedsDarkTabImage;

@property (nonatomic, strong) NSString *filterText3;
@property (nonatomic, readonly) UIView *filterViewSection3;
@property (nonatomic, assign) BOOL filter3NeedsDarkTabImage;

@property (nonatomic, assign) NVFilterStyle filterStyle;
@property (nonatomic, readwrite,assign) NSInteger filterBtnOnOffState;

@property (nonatomic, assign) id<NVFilterControllerDelegate> delegate;
@property (nonatomic, assign) BOOL disable;

@property (nonatomic, readonly) BOOL filter1NeedsOn;
@property (nonatomic, readonly) BOOL filter2NeedsOn;
@property (nonatomic, readonly) BOOL filter3NeedsOn;

- (id)initWithFrame:(CGRect)frame withFilterCount:(int)filterCnt;
// 显示筛选框，将会触发NVFilterControllerDelegate
- (void)showPickerWithFilterType:(FilterType)filterType selectedRow1:(NSInteger)row1 selectedRow2:(NSInteger)row2;

- (void)resetFilterBtnsStates;

- (void)setEnable:(BOOL)enable buttonIndex:(int)index;

@end


@protocol NVFilterControllerDelegate <NSObject>
@optional
// 点击了筛选框的按钮
- (void)filterController:(NVFilterController *)controller touchedFilter:(FilterType)filterType;

@end

